package com.lowrisk.springcloud;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.Date;

/**
 * @Author jiadianduo
 * @Description:
 * @Date:Created in 2019/3/24 10:27
 */
@RestController
public class UserController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/findOrderByUser/{id}")
    public String findOrderByUser(@PathVariable String id){
        String oid = "123";
        return restTemplate.getForObject("http://microservice-eureka-order/order/"+oid+"?time="+new Date().getTime(),String.class);
    }

}
